package com.aplink.generic.pojo.controlspec;

import java.util.ArrayList;

import android.text.TextUtils;

import com.aplink.generic.util.ResourcesHelper;
import com.aplink.generic.util.validation.Validation;

public class AutoCompleteTextViewSpec extends ControlSpec {
    private static final long serialVersionUID = 757836246789976096L;
	private String defaultValue;
	private boolean isTouchToShowDropDown;
	private int mCompletionThreshold;
	private String mContentData;
	private String mDisplayProperty;
	private String mRowItem;
	private String mRprtDesign;
	private ArrayList<String> mSearchFields;
	private String mShowAllButton;
	private Validation mValidation;
	private String mValueProperty;

	public AutoCompleteTextViewSpec() {
		mSearchFields = new ArrayList<>();
	}

	public final int getCompletionThreshold() {
		return mCompletionThreshold;
	}

	public final String getContentData() {
		return mContentData;
	}

	public int getContentDataID() {
		if (!TextUtils.isEmpty(mContentData)) {
			return ResourcesHelper.getRawIdByName(mContentData);
		}
		return ResourcesHelper.RESOURCE_NOT_FOUND;
	}

	public final String getDefaultValue() {
		return defaultValue;
	}

	public final String getDisplayProperty() {
		return mDisplayProperty;
	}

	public String getRowItem() {
		return mRowItem;
	}

	public int getRowItemID() {
		if (!TextUtils.isEmpty(mRowItem)) {
			return ResourcesHelper.getLayoutIdByName(mRowItem);
		}
		return ResourcesHelper.RESOURCE_NOT_FOUND;
	}

	public String getRprtDesign() {
		return mRprtDesign;
	}

	public int getRptDesignID() {
		if (!TextUtils.isEmpty(mRprtDesign)) {
			return ResourcesHelper.getRawIdByName(mRprtDesign);
		}
		return ResourcesHelper.RESOURCE_NOT_FOUND;
	}

	public ArrayList<String> getSearchFields() {
		return mSearchFields;
	}

	public String getShowAllButton() {
		return mShowAllButton;
	}

	public Validation getValidation() {
		return mValidation;
	}

	public final String getValueProperty() {
		return mValueProperty;
	}

	public final boolean isTouchToShowDropDown() {
		return isTouchToShowDropDown;
	}

	public final void setCompletionThreshold(final int completionThreshold) {
		mCompletionThreshold = completionThreshold;
	}

	public final void setContentData(final String contentData) {
		mContentData = contentData;
	}

	public final void setDefaultValue(final String defaultValue) {
		this.defaultValue = defaultValue;
	}

	public final void setDisplayProperty(final String displayProperty) {
		mDisplayProperty = displayProperty;
	}

	public void setRowItem(final String rowItem) {
		mRowItem = rowItem;
	}

	public void setRprtDesign(final String rprtDesign) {
		mRprtDesign = rprtDesign;
	}

	public void setSearchFields(final ArrayList<String> searchFields) {
		mSearchFields = searchFields;
	}

	public void setShowAllButton(final String showAllButton) {
		mShowAllButton = showAllButton;
	}

	public final void setTouchToShowDropDown(final boolean isTouchToShowDropDown) {
		this.isTouchToShowDropDown = isTouchToShowDropDown;
	}

	public void setValidation(Validation validation) {
		mValidation = validation;
	}

	public final void setValueProperty(final String valueProperty) {
		mValueProperty = valueProperty;
	}

}
